package com.goudan.mybatisplus.config;

import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import springfox.documentation.builders.ApiInfoBuilder;
import springfox.documentation.builders.RequestHandlerSelectors;
import springfox.documentation.service.ApiInfo;
import springfox.documentation.service.Contact;
import springfox.documentation.spi.DocumentationType;
import springfox.documentation.spring.web.plugins.Docket;

@Configuration
public class SwaggerConfig {

    /**
     * Swagger中全局配置对象
     */
    @Bean
    public Docket docket() {
        DocumentationType documentationType;
        Docket docket = new Docket(DocumentationType.SWAGGER_2);
        ApiInfo apiInfo = new ApiInfoBuilder().title("李苟蛋Swagger学习文档").description("我是李苟蛋开发文档")
                .contact(new Contact("李苟蛋Swagger开发文档","",""))
                .version("1.0").build();
        docket.apiInfo(apiInfo);
        docket.select().apis(RequestHandlerSelectors.basePackage("com.goudan.mybatisplus.controller"));
        return docket;

    }
}
